home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.20000824-20010305 / 000151_news@columbia.edu _Thu Dec 28 15:42:35 2000.msg < prev    next >
Internet Message Format  |  2020-01-01  |  2KB

  1. Return-Path: <news@columbia.edu>
  2. Received: from watsun.cc.columbia.edu (watsun.cc.columbia.edu [128.59.39.2])
  3.     by monire.cc.columbia.edu (8.9.3/8.9.3) with ESMTP id PAA22527
  4.     for <kermit.misc@cpunix.cc.columbia.edu>; Thu, 28 Dec 2000 15:42:35 -0500 (EST)
  5. Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.59.30])
  6.     by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id PAA01199
  7.     for <kermit.misc@watsun.cc.columbia.edu>; Thu, 28 Dec 2000 15:42:34 -0500 (EST)
  8. Received: (from news@localhost)
  9.     by newsmaster.cc.columbia.edu (8.9.3/8.9.3) id PAA28135
  10.     for kermit.misc@watsun.cc.columbia.edu; Thu, 28 Dec 2000 15:31:05 -0500 (EST)
  11. X-Authentication-Warning: newsmaster.cc.columbia.edu: news set sender to <news> using -f
  12. Message-ID: <3A4BA47C.53C64EBA@srv.net>
  13. From: Kevin Handy <kth@srv.net>
  14. Organization: Software Solutions, Inc
  15. Subject: Re: A wish for the FTP-client
  16. Date: Thu, 28 Dec 2000 13:37:16 -0700
  17. To: kermit.misc@columbia.edu
  18.  
  19. Frank da Cruz wrote:
  20. > In article <92g302$65t$1@localhost.localdomain>,
  21. >
  22. > I looked into this, and it would be easy enough to do, except for one
  23. > thing: the lack of a critical API.  When you send MDTM <filename> to
  24. > the server, it sends back a string like this:
  25. >   20001228143521
  26. > representing 28 December 2000 14:35:21 (UTC/GMT).  It is quite easy to
  27. > convert this to a struct tm.  But to change a file's date (with utime()
  28. > or utimes()) requires a time_t, not a struct tm.  How do you convert a
  29. > struct tm to a time_t in a reliable way? -- i.e. without writing code to
  30. > count days, months, years, leap years, leap seconds, and all the rest,
  31. > taking each machine's architecture into account.  I'm sure I must have
  32. > overlooked something obvious -- feel free to embarrass me.
  33.  
  34. Under *nix, I believe the function to use is mktime
  35.  
  36.     time_t mktime(struct tm *timeptr)
  37.  
  38.